package com.hzsxy.bighomework.repository;


import com.hzsxy.bighomework.entity.StudentClassDO;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Created by 张晨 on 2018/11/28.
 */
@Repository
public interface StudentClassRepository extends CrudRepository<StudentClassDO,String> {

    Iterable<StudentClassDO> findByClassId(String classId);

    List<StudentClassDO> findByClassIdAndStudentId(String classId, String studentId);

    @Transactional
    void deleteByClassId(String classId);

    List<StudentClassDO> findByStudentId(String studentId);

}
